<?php

	if ($this->_controls)
	{
		foreach ($this->_controls as $ctrl)
			$ctrl->render($webpage, $depth + 1);
	}

	if ($this->_images_list)
	{
		echo "\n<div class='___QImageGallery'>\n";
		$pos = 0;
		foreach ($this->_images_list as $img)
		{
			echo "\n<a class='___QImageGallery_div".(($pos==0) ? " active" : "").(isset($img["extra_class"]) ? " {$img["extra_class"]}" : "")."' href='".
				(($img["link"]) ? $img["link"] : "javascript: //")."'>\n".
				
				"<img src=\"".htmlspecialchars($img["src"])."\" ".
				((($img["caption"]) && $img["caption"]) ? "alt=\"".htmlspecialchars($img["caption"])."\"" : "")." />\n".
				($img["html"] ? "<div class='___QImageGallery_html'>{$img["html"]}</div>\n" : "").
				"</a>\n";
			$pos++;
		}
		echo "</div>\n";
	}
?>